﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CourseSelectionSystem
{
    public partial class AddStudent : Form
    {
        private readonly CourseSelectionSystemServices service = new CourseSelectionSystemServices();
        public AddStudent()
        {
            InitializeComponent();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            CreateModels models = new CreateModels()
            {
                ID = textID.Text,
                Name = textName.Text,
                Class = textClass.Text,
                Password = textPassword.Text,
                Hometown = textHometown.Text,
            };
            service.Creates(models);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
